package com.school.manager.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.school.manager.domaim.SysCourse;
import com.school.manager.entity.po.SysCoursePo;
import com.school.manager.entity.vo.SysCourseVo;
import com.school.manager.mapper.SysCourseMapper;
import com.school.manager.service.ISysCourseService;
import com.school.manager.utils.PageUtil;

import lombok.extern.slf4j.Slf4j;

/**
 * description：用户课程业务实现类
 * date：2021/10/133:18 下午
 */

@Service
@Slf4j
public class SysCourseServiceImpl extends ServiceImpl<SysCourseMapper, SysCourse> implements ISysCourseService {
	
	@Autowired
    private SysCourseMapper sysCourseMapper;
	
	@Override
	public Page<SysCourseVo> page(SysCoursePo sysCoursePo) {
		QueryWrapper<SysCourse> queryWrapper = PageUtil.buildQueryWrapper(sysCoursePo, SysCourse.class);
        Page<SysCourse> page = new Page<>(sysCoursePo.getCurrent(), sysCoursePo.getSize());
        sysCourseMapper.selectPage(page, queryWrapper);
        return PageUtil.buildPage(page, SysCourseVo.class);
	}
	
	

}
